package com.jn.erp.web.api.course.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author wyp
 * @since 2024-09-04
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class TCourseOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 创建者所属组织ID
     */
    private Long orgId;

    /**
     * 排課配置id
     */
    private Long cofId;

    /**
     * 课程编号
     */
    private String orderNo;

    /**
     * 状态
     */
    private Integer state;

    /**
     * 课程id
     */
    private Long courseId;

    /**
     * 班级id
     */
    private Long classId;

    /**
     * 上课日期
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name ="上课日期")
    private LocalDateTime classDate;

    /**
     * 试听学员状态
     */
    private Integer type;



    /**
     * 上课开始时间
     */
    private String classStartTime;

    /**
     * 上课结束时间
     */
    private String classEndTime;

    /**
     * 上课日期周几
     */
    private Integer weekNum;

    /**
     * 学员id
     */
    private Long studentId;

    /**
     * 老师id
     */
    private Long teacher;

    /**
     * 助教
     */
    private String assistant;

    /**
     * 教室id
     */
    private Long classRoom;

    /**
     * 描述
     */
    private String description;

    /**
     * 是否已补完
     */
    private String repairState;

    /**
     * 应扣课时
     */
    private Integer classHour;

    /**
     * 实扣课时
     */
    @Excel(name ="实扣课时")
    private Integer classHourPay;


    /**
     * 实扣课时(正常)
     */
    private Integer classHourPayNormal;

    /**
     * 扣除课时类型0正常课时1赠送课时2复合扣课时
     */
    private String classHourPayType;

    /**
     * 点名时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime callTime;

    /**
     * 备注
     */
    private String remark;

    /**
     * 0临时学员1正常学员 2补课学员 3试听
     */
    private Integer temp;

    /**
     * 所补课课次号--旧的课次号
     */
    private String tempOrderNo;

    /**
     * 消费的订单id
     */
    private Long tscId;

    /**
     * 是否报名 0否 1是
     */
    @Excel(name ="是否报名")
    private String isApplication;

    /**
     * 报名时间
     */
    @Excel(name ="报名时间")
    private String applicationTime;


    /**
     * 创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;

    /**
     * 创建人
     */
    private String createUser;

    /**
     * 修改时间
     */
    private LocalDateTime updateDate;

    /**
     * 修改人
     */
    private String updateUser;

    /**
     * 是否删除 0否 1是
     */
    private String isDelete;

    @TableField(exist = false)
    private String classDates;

    @TableField(exist = false)
    private Integer classHourPayNormalTotal;

    public TCourseOrder(Long orgId, Long cofId, String orderNo, Integer state, Long courseId, Long classId, LocalDateTime classDate, String classStartTime, String classEndTime, Integer weekNum, Long studentId, Long teacher, String assistant, Long classRoom, String description, String repairState, Integer classHour, Integer classHourPay, LocalDateTime callTime, String remark, Integer temp, String tempOrderNo, LocalDateTime createDate, String createUser, LocalDateTime updateDate, String updateUser, String isDelete) {
        this.orgId = orgId;
        this.cofId = cofId;
        this.orderNo = orderNo;
        this.state = state;
        this.courseId = courseId;
        this.classId = classId;
        this.classDate = classDate;
        this.classStartTime = classStartTime;
        this.classEndTime = classEndTime;
        this.weekNum = weekNum;
        this.studentId = studentId;
        this.teacher = teacher;
        this.assistant = assistant;
        this.classRoom = classRoom;
        this.description = description;
        this.repairState = repairState;
        this.classHour = classHour;
        this.classHourPay = classHourPay;
        this.callTime = callTime;
        this.remark = remark;
        this.temp = temp;
        this.tempOrderNo = tempOrderNo;
        this.createDate = createDate;
        this.createUser = createUser;
        this.updateDate = updateDate;
        this.updateUser = updateUser;
        this.isDelete = isDelete;

    }

    public TCourseOrder(String isApplication, String applicationTime, LocalDateTime updateDate, String updateUser) {
        this.isApplication = isApplication;
        this.applicationTime = applicationTime;
        this.updateDate = updateDate;
        this.updateUser = updateUser;
    }
}
